<?php

/**
 * StaffEvent form.
 *
 * @package    erp-dnict
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class StaffEventForm extends BaseStaffEventForm
{
  public function configure()
  {
  	$this->setWidgets(array(
        'name'       					=>  new sfWidgetFormInput(),
        'description'           		=>  new sfWidgetFormInput(),
        'start_date'                 	=>  new sfWidgetFormInput(),
        'document_id'                 	=>  new sfWidgetFormInput(),
        ));

  	$this->widgetSchema->setLabels(array(
  		'name'							=>	'Tên:',
  		'description'					=>	'Mô tả:',
  		'start_date'					=>	'Ngày:',
  		'document_id'					=>	'Quyết định số:',
  		));

  	$this->setValidators(array(
  		'name'							=> new sfValidatorString(array('required' => true)),
  		'description'					=> new sfValidatorString(array('required' => true)),
  		'start_date'					=> new sfValidatorDate(array('required' => true, 'date_output' => 'dd/mm/yy', 'date_format' => "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/")),
  		'document_id'					=> new sfValidatorString(array('required' => true)),
  		));

  	$this->widgetSchema->setNameFormat('staff_event[%s]');
  }
}
